package com.hrhx.duhongming.core;

import java.util.List;
import java.util.Map;

import com.github.abel533.echarts.json.GsonOption;
import com.hrhx.duhongming.adapter.EchartsDoubleNumLineAdapter;
import com.hrhx.duhongming.adapter.EchartsLineAndBarAdapter;
import com.hrhx.duhongming.adapter.EchartsMapAdapter;
import com.hrhx.duhongming.adapter.EchartsPieAdapter;
import com.hrhx.duhongming.adapter.EchartsRadarAdapter;
import com.hrhx.duhongming.adapter.EchartsReverseBarAdapter;
import com.hrhx.duhongming.bean.EchartsConfig;

public class EchartsCore extends EchartsBaseCore{

	public GsonOption getBaseGsonOption(EchartsConfig echartsConfig){
		//1.获取option对象
		GsonOption gsonOption = getBaseTitle(echartsConfig);
		//2.提示信息
		getBaseTooltip(echartsConfig);
		//3.工具栏处理
		getBarAndLineToolBox(echartsConfig);
		//4.数据域缩放处理
		getDataZoom(echartsConfig);
		//5.视觉映射组件
		getVisualMap(echartsConfig);
		return gsonOption;
	}
	
	public GsonOption adapterLineAndBar(EchartsConfig echartsConfig,GsonOption gsonOption,List<Map<String,Object>> data){		
		return EchartsLineAndBarAdapter.adapter(echartsConfig,gsonOption,data);
	}
	
	public GsonOption adapterPie(EchartsConfig echartsConfig,GsonOption gsonOption,Map<String,Object> data){		
		return EchartsPieAdapter.adapter(echartsConfig,gsonOption,data);
	}
	
	public GsonOption adapterDoubleNumLine(EchartsConfig echartsConfig,GsonOption gsonOption,Map<String,Double[][]> data){		
		return EchartsDoubleNumLineAdapter.adapter(echartsConfig,gsonOption,data);
	}
	
	public GsonOption adapterReverseBar(EchartsConfig echartsConfig,GsonOption gsonOption,List<Map<String,Object>> data){		
		return EchartsReverseBarAdapter.adapter(echartsConfig,gsonOption,data);
	}
	
	public GsonOption adapterRadar(EchartsConfig echartsConfig,GsonOption gsonOption,List<Map<String,Object>> data){		
		return EchartsRadarAdapter.adapter(echartsConfig,gsonOption,data);
	}

	public GsonOption adapterMap(EchartsConfig echartsConfig, GsonOption gsonOption,Map<String, Map<String, Double>> data) {
		return EchartsMapAdapter.adapter(echartsConfig,gsonOption,data);
	}
	
}
